package com.feituan.wx.controller;

import com.feituan.core.persistence.service.IActivityService;
import com.feituan.core.persistence.service.INoticeService;
import com.feituan.core.persistence.service.IPosterImageService;
import com.feituan.core.persistence.service.IProtocolService;
import com.feituan.core.pojo.entity.Activity;
import com.feituan.core.pojo.entity.Notice;
import com.feituan.core.pojo.entity.PosterImage;
import com.feituan.core.pojo.entity.Protocol;
import com.feituan.core.pojo.response.Response;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping(value = "/system")
@Api(tags = "系统管理（消息，广告图）")
public class SystemController {

    @Autowired
    private INoticeService noticeService;
    @Autowired
    private IActivityService activityService;
    @Autowired
    private IProtocolService protocolService;
    @Autowired
    private IPosterImageService iPosterImageService;

    @PostMapping("/notice_list")
    @ApiOperation("系统消息列表")
    public Response<List<Notice>> noticelist() {
        return Response.success(noticeService.list());
    }
    @PostMapping("/poster_image")
    @ApiOperation("广告图")
    public Response<List<PosterImage>> posterImage() {
        return Response.success(iPosterImageService.list());
    }
    @PostMapping("/activity_list")
    @ApiOperation("活动列表")
    public Response<List<Activity>> activityList() {
        return Response.success(activityService.list());
    }
    @PostMapping("/protocol_list")
    @ApiOperation("协议列表")
    public Response<List<Protocol>> protocolList() {
        return Response.success(protocolService.list());
    }
}
